package com.fading.mall.member.controller;


import com.fading.common.utils.R;
import com.fading.mall.member.entity.MemberEntity;
import com.fading.mall.member.feign.CouponFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("member/coupon")
@RefreshScope
public class CouponMsg {

    @Value("${mem.user.id}")
    private Integer id;

    @Value("${mem.user.name}")
    private String name;

    @Value("${mem.user.father}")
    private String father;

    @Autowired
    CouponFeign couponFeign;


    @GetMapping("/getInfo")
    public R getInfo(){
        return R.ok().put("id", id).put("name", name).put("father", father);
    }

    @RequestMapping("get")
    public String get(){
        return "冬泳怪鸽";
    }

    @GetMapping("/getCoupon")
    public R getCoupon(){
        return couponFeign.memberCoupon();
    }

    @GetMapping("/ajax")
    public R ajax(){
        return R.ok().put("谁敢横刀立马", "冬泳怪鸽本人");
    }


}
